1. Field
The present disclosure is generally related to hardware-based virtual devices.
2. Background
A virtual machine (VM) is an isolated guest operating system (OS) installation within a host in a virtualized environment. A virtualized environment runs one or more VMs in the same system simultaneously or in a time-sliced fashion. Hardware-based virtualization allows for guest VMs to behave as if they are in a native environment, since guest OSs and VM drivers may have minimal awareness of their VM status.
Hardware-based virtualized environments can include physical functions (PFs) and virtual functions (VFs). PFs are full-featured express functions that include configuration resources (for example, a PCI-Express function). Virtual functions (VFs) can be “lightweight” functions that generally lack configuration resources. In a virtual environment, there may be one VF per VM, and a VF may be assigned to a VM by a hypervisor. A hypervisor is a piece of computer software, firmware or hardware that creates and runs virtual machines. A computer on which a hypervisor is running one or more virtual machines is defined as a host machine. Each virtual machine is called a guest machine. The hypervisor provides the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems. Multiple instances of a variety of operating systems may share the virtualized hardware resources.
Single root input/output virtualization (SR-IOV) functionality provides a standardized approach to the sharing of IO physical devices in a virtualized environment. SR-IOV functionality and standards have been addressed in the Single Root I/O Virtualization and Sharing Specification, Revision 1.0, Sep. 11, 2007, which is incorporated herein by reference. In particular, SR-IOV allows a single Peripheral Component Interconnect Express (PCIe) physical device under a single root port to appear as multiple separate physical devices to the hypervisor or the guest operating system. For example, the IO device can be configured by a hypervisor to appear in a peripheral component interconnect (PCI) configuration space as multiple functions, with each function having its own configuration space. SR-IOV uses PFs and VFs to manage global functions for the SR-IOV devices. PFs are full-featured PCIe Functions: they are discovered, managed, and manipulated in a similar manner as a standard PCIe device. As discussed previously, PFs have full configuration resource, which allows the PF to configure or control the PCIe device and also transfer data in and out of the device. VFs are similar to PFs but lack configuration resources. VFs generally have the ability to transfer data.
A SR-IOV interface is an extension to a peripheral component interconnect express (PCIe) specification. The SR-IOV interface allows a device, for example, a network adapter, to divide access to its resources among various PCIe functions. During operation, a device malfunction may be detected by a virtual function or a physical function, which requires a reset. However, existing application specific integrated circuit (ASIC) reset procedures do not allow reset of only a specific VF or PF without resetting the entire ASIC. Further, as each function in a virtualized system is allocated a small time slice, the device or the processor may end up in an uncertain state when existing ASIC reset procedures are used.